from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.webdriver import WebDriver

from test_appium.test_wechat.PO.PO_page.BasePage import BasePage


class AddMember_Page(BasePage):

    add_by_phonenumber_btn = (MobileBy.XPATH,"//*[@resource-id='com.tencent.wework:id/j32'and@class='android.widget.ImageView']")


    def click_addmember_menual(self):
        """
        点击手动输入添加
        跳转到编辑成员页面
        :return:
        """
        from test_appium.test_wechat.PO.PO_page.EditMember_Page import addmember_menual_Page
       # add_by_phonenumber_btn = self.driver.find_element_by_xpath(
       #     "//*[@resource-id='com.tencent.wework:id/j32'and@class='android.widget.ImageView']")
        self.find_and_click(*self.add_by_phonenumber_btn)
        self.driver.implicitly_wait(10)
        return addmember_menual_Page(self.driver)

    def get_tip(self):
        result = self.driver.find_element_by_xpath("//*[@class='android.widget.Toast']").get_attribute("text")
        return result

